<style>
.btn.btn-success-o{
    background: #fff;
    border: 1px solid red;
    color: #333;
}
.btn.btn-success-o.active{
    background: #fdb2b2;
    border: 1px solid red;
    color: red;
}
.btn.btn-success-o.active .subtitle{
    color: red;
}
.btn.btn-success-o.active::after{content:" ";width:23px;height:24px;background:url(../core/resource/images/gou-red.png) no-repeat;position:absolute;float:right;right:-1px;bottom:-1px;text-align:center;}
.jy-image-typetitle {
    float: right;
    top: 0.3rem;
    left: 0.2rem;
    padding: 2px 6px;
    position: absolute;
    color: #fff;
    background: #f60;
    font-size: 12px;
    border-bottom-right-radius: 16px;
	border-top-left-radius: 16px;
    z-index: 3;
}
</style>
<div class='fui-page fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left">
			<a class="back" ng-click="goback()"></a>
		</div>
		<div class="title">金币充值</div> 
		<div class="fui-header-right">&nbsp;</div>
    </div>
    <div class="fui-content">
		<div style="padding:0 0.5rem">
		<div style="padding:0.2rem;padding-top:1rem">
		<div class='bold' style="font-size:1rem">选择套餐</div>
		<div class='gray' style="font-size:0.6rem">当前余额:￥{{pagedata.item.credit2}}</div>
		</div>
		<div class="fui-icon-group noborder col-3" style="margin-top:0.5rem">
			<div ng-repeat="item in pagedata.redfeeset" ng-click="pagedata.item.money=item.fee;pagedata.item.key=$index" class="fui-icon-col-sm" style="margin:0;padding:0 0.2rem;padding-top:1rem">
					<div ng-class="{'btn btn-success-o':1,'active':pagedata.item.money==item.fee}" style="line-height:1.4;margin:0;padding:1rem 0.3rem;width:100%">
					<div class="subtitle">{{item.binum}}金币</div>
					<div class="bold" style="font-size:1.3rem;">￥{{item.fee}}</div>
					</div>
					<div ng-if="item.addnum >0" class="jy-image-typetitle">送{{item.addnum}}金币</div>
			</div>
		</div>
		<a href="javascript:;" class='btn btn-success block' style="background:red;border-radius:1rem;line-height: 3;margin-top:1.5rem" ng-click="pagedata.recharge()">确认充值</a>
		<a href="javascript:;" class='btn btn-gray block' style="border-radius:1rem;line-height: 3;" ng-click="access_json('jy_chatwenxin/home/')">返回中心</a>
		<div class='red' style="font-size:0.6rem;padding:0 0.5rem;">购买提醒:1、金币不限使用时间；2、不支持退款、提现转赠他人。</div>
		</div>
</div>
<script>
scope.pagedata.recharge=function(){
	scope.post_json('/recharge/recharge/',scope.pagedata.item,function(pay_id){
		console.log('pay_id');console.log(pay_id);
		scope.tool.pay(pay_id,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.message('充值成功！','','jy_chatwenxin/home/');
				}else{
					scope.message('充值失败！'+res.message,'','jy_chatwenxin/home/');
				}
		},'','','jy_chatwenxin/home/');
	});
}
</script>